import Vue from 'vue'
import Router from 'vue-router'
// 登录、注册、忘记密码
import Login from '@/pages/user/login/login'
import Regeister from '@/pages/user/regeister/regeister'
import ForgetPass from '@/pages/user/forgetPass/forgetpass'
// 主页
const Home = () => import('@/pages/home/home')
const MyHome = () => import('@/pages/home/MyHome')

const Browse = () => import('@/pages/browse/browse')
const InterfaceAll = () => import('@/pages/interface/interfaceall')
const InterfaceDesc = () => import('@/pages/interface/interfacedesc')
const InterfaceTest = () => import('@/pages/interface/interfacetest')
const InterfaceBuy = () => import('@/pages/interface/interfacebuy')
const InterfaceOrder = () => import('@/pages/interface/interfaceorder')
const Help = () => import('@/pages/help/help')
const Background = () => import('@/pages/user/home/background')

Vue.use(Router)

const RouterInstance = new Router({
  routes: [
    {
      path: '/',
      redirect: '/myhome'
    }, {
      path: '/',
      name: 'Home',
      component: Home,
      children: [
        {
          path: 'myhome',
          name: 'MyHome',
          component: MyHome
        },
        {
          path: 'interfaceall',
          name: 'InterfaceAll',
          component: InterfaceAll
        },
        {
          path: 'browse',
          name: 'Browse',
          component: Browse
        }, {
          path: 'help',
          name: 'Help',
          component: Help
        }
      ]
    }, {
      path: '/login',
      name: 'Login',
      component: Login
    }, {
      path: '/regeister',
      name: 'Regeister',
      component: Regeister
    }, {
      path: '/forgetpass',
      name: 'ForgetPass',
      component: ForgetPass
    }, {
      path: '/interfacedesc',
      name: 'InterfaceDesc',
      component: InterfaceDesc
    }, {
      path: '/interfacetest',
      name: 'InterfaceTest',
      component: InterfaceTest
    }, {
      path: '/interfacebuy',
      name: 'InterfaceBuy',
      component: InterfaceBuy
    }, {
      path: '/interfaceorder',
      name: 'InterfaceOrder',
      component: InterfaceOrder
    }, {
      path: '/background',
      name: 'Background',
      component: Background
    }
  ]
})

export default RouterInstance
